<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul class="ul">
        <li class="news"data-index=0>军事</li>
        <li class="news"data-index=1>美食</li>
        <li class="news"data-index=2>经济</li>
        <li class="news"data-index=3>动画</li>
        <li class="news"data-index=4>其他</li>
    </ul>

    <script>
        var ul = document.querySelector('ul');

        ul.onclick = function () {
            var target = event.target;
            if (target.tagName === 'LI') {
                location = 'newsDetail.html?title=' + target.dataset.index + '&name=libai'
            }
        }
    </script>
</body>
</html>